#include "../Headers/day05_link.h"
TEMP_CLASS(T)::link()
{
    this->nd = new node<T>;
    nd->next = NULL;
}
TEMP_CLASS(T)::~link()
{

    while (this->nd)
    {
        node<T>* temp = this->nd->next;
        delete this->nd;
        this->nd = temp;
    }
}
TEMP_pb_func(T, void)::insertHead(T data)
{
    node<T> *new_n = new node<T>;
    new_n->data = data;
    new_n->next = this->nd->next;
    this->nd->next = new_n;
}
template <class T1>
ostream &operator<<(ostream &out, link<T1> &lk)
{
    node<T1> *temp = lk.nd->next;
    while (temp)
    {
        out << temp->data;
        temp = temp->next;
    }
    return out;
}

